<?php   // $Id: article_update.php 255 2008-08-07 07:14:14Z pcoustillas $ ?>
<?php   
/*Copyright (C) 2003-2004 Guy Hendrickx
Licensed under the terms of the GNU  General Public License:http://www.opensource.org/licenses/gpl-license.php
File Authors:Guy Hendrickx */
require_once("include/verif.php");
require_once("include/config/common.php");

$article=isset($_POST['article'])?$_POST['article']:"";
$tva=isset($_POST['taux_tva'])?$_POST['taux_tva']:"";
$prix=isset($_POST['prix'])?$_POST['prix']:"";
$stock=isset($_POST['stock'])?$_POST['stock']:"";
$max=isset($_POST['max'])?$_POST['max']:"";
$min=isset($_POST['min'])?$_POST['min']:"";
$categorie=isset($_POST['categorie'])?$_POST['categorie']:"";



//on recoit toujours les prix et la tva
$sql_article = "UPDATE ${tblpref}article SET `prix_htva`='$prix',`taux_tva`='$tva' ";
if ($stock != "" && $max != "" && $min != "")
{
	$sql_article.=" ,`stock`='$stock',`stomin`='$min',`stomax`='$max' ";
}
if ($categorie!="")
{
	$sql_article.=", `cat`='$categorie'";
}

$sql_article.="WHERE num ='$article'";

mysql_query($sql_article) or die("Erreur mise à jour article<br/>$sql_article<br/>" . mysql_error());

header("Location: article_lister.php");
?>